*Import CSV with "First row as variable names: Always"
*Variable Transformations
gen govfunded = .
replace govfunded = 1 if q51 == "Funded by the government of a country"
replace govfunded = 0 if q51 == "Independently funded"
replace govfunded = 0 if q51 == "Don't know"
gen super = .
replace super = 1 if group == "supertag"
replace super = 0 if group != "supertag"
gen control = .
gen tag = .
gen notag = .
replace tag = 1 if group == "Tag"
replace tag = 0 if group != "Tag"
replace notag = 1 if group == "NoTag"
replace notag = 0 if group != "NoTag"
replace control = 1 if group == "control"
replace control = 0 if group != "control"
gen noticedtag = .
replace noticedtag = 1 if strpos(q52, "A statement that RT was funded by the Russian Government")
replace noticedtag = 0 if !strpos(q52, "A statement that RT was funded by the Russian Government")
gen madeupnews = .
replace madeupnews = 4 if q106 == "A very big problem"
replace madeupnews = 3 if q106 == "A moderately big problem"
replace madeupnews = 3 if q106 == "A small problem"
replace madeupnews = 3 if q106 == "Not a problem at all"
gen sawvideo = .
replace sawvideo = 1 if control == 0
replace sawvideo = 0 if control == 1
gen russiandanger = .
replace russiandanger = 4 if q92_5 == "Very concerned" 
replace russiandanger = 3 if q92_5 == "Somewhat concerned" 
replace russiandanger = 2 if q92_5 == "Not very concerned" 
replace russiandanger = 1 if q92_5 == "Not at all concerned" 
gen journalisttrust = .
replace journalisttrust = 1 if q108_1 == "A great deal of confidence"
replace journalisttrust = 2 if q108_1 == "A fair amount of confidence"
replace journalisttrust = 3 if q108_1 == "Not too much confidence"
replace journalisttrust = 4 if q108_1 == "No confidence at all"
gen russia2016 = .
replace russia2016 = 1 if q42 == "Very accurate"
replace russia2016 = 2 if q42 == "Somewhat accurate"
replace russia2016 = 3 if q42 == "Somewhat inaccurate"
replace russia2016 = 4 if q42 == "Very inaccurate"
gen fakenewsdanger = .
replace fakenewsdanger = 4 if q92_4 == "Very concerned"
replace fakenewsdanger = 3 if q92_4 == "Somehwat concerned"
replace fakenewsdanger = 3 if q92_4 == "Someewhat concerned"
replace fakenewsdanger = 3 if q92_4 == "Somewhat concerned"
replace fakenewsdanger = 2 if q92_4 == "Not very concerned"
replace fakenewsdanger = 2 if q92_4 == "Not at all concerned"
gen foreigndisinfo = .
replace foreigndisinfo = 4 if q105_4 == "A great deal of influence"
replace foreigndisinfo = 3 if q105_4 == "Some influence"
replace foreigndisinfo = 2 if q105_4 == "Not much influence"
replace foreigndisinfo = 1 if q105_4 == "No influence at all"
gen socialdisinfo = .
replace socialdisinfo = 4 if q105_1 == "A great deal of influence"
replace socialdisinfo = 3 if q105_1 == "Some influence"
replace socialdisinfo = 2 if q105_1 == "Not much influence"
replace socialdisinfo = 1 if q105_1 == "No influence at all"
gen fakenewsbyjourno = .
replace fakenewsbyjourno = 3 if q107_1 == "A lot"
replace fakenewsbyjourno = 2 if q107_1 == "Some"
replace fakenewsbyjourno = 1 if q107_1 == "Not much"
gen fakenewsbygov = .
replace fakenewsbygov = 3 if q107_5 == "A lot"
replace fakenewsbygov = 2 if q107_5 == "Some"
replace fakenewsbygov = 1 if q107_5 == "Not much"
gen trustinmainstream = .
replace trustinmainstream = 4 if q111_6 == "A great deal"
replace trustinmainstream = 3 if q111_6 == "Some"
replace trustinmainstream = 2 if q111_6 == "Not much"
replace trustinmainstream = 1 if q111_6 == "Not at all"
gen madeupnewselections = .
replace madeupnewselections = 4 if q112_5 == "Very worried"
replace madeupnewselections = 3 if q112_5 == "Somewhat worried"
replace madeupnewselections = 2 if q112_5 == "Only a little worried"
replace madeupnewselections = 1 if q112_5 == "Not at all worried"
gen trustmainoutlets = .
replace trustmainoutlets = 4 if q111_1 == "A great deal"
replace trustmainoutlets = 3 if q111_1 == "Some"
replace trustmainoutlets = 2 if q111_1 == "Not much"
replace trustmainoutlets = 1 if q111_1 == "Not at all"
gen sawvideonotag = .
replace sawvideonotag = 1 if sawvideo == 1 & noticedtag == 0
replace sawvideonotag = 0 if sawvideonotag != 1
gen madeupnewsaverageamericans = .
replace madeupnewsaverageamericans = 4 if q112_2 == "Very worried"
replace madeupnewsaverageamericans = 3 if q112_2 == "Somewhat worried"
replace madeupnewsaverageamericans = 2 if q112_2 == "Only a little worried"
replace madeupnewsaverageamericans = 1 if q112_2 == "Not at all worried"
gen trustinoutlets2 = .
replace trustinoutlets2 = 4 if q111_2 == "A great deal"
replace trustinoutlets2 = 3 if q111_2 == "Some"
replace trustinoutlets2 = 2 if q111_2 == "Not much"
replace trustinoutlets2 = 1 if q111_2 == "Not at all"
gen trustinsocialmedia = .
replace trustinsocialmedia = 4 if q111_5 == "A great deal"
replace trustinsocialmedia = 3 if q111_5 == "Some"
replace trustinsocialmedia = 2 if q111_5 == "Not much"
replace trustinsocialmedia = 1 if q111_5 == "Not at all"
gen trustinnewsfrompolitical = .
replace trustinnewsfrompolitical = 4 if q111_3 == "A great deal"
replace trustinnewsfrompolitical = 3 if q111_3 == "Some"
replace trustinnewsfrompolitical = 2 if q111_3 == "Not much"
replace trustinnewsfrompolitical = 1 if q111_3 == "Not at all"
gen republican = .
replace republican = 1 if q328 == "Republican"
replace republican = 1 if q331 == "the Republican Party"
replace republican = 0 if q331 == "the Democratic Party"
replace republican = 0 if q328 == "Democrat"
gen partyid =.
replace partyid = 1 if q328 == "Republican"
replace partyid = .5 if q331 == "the Republican Party"
replace partyid = -.5 if q331 == "the Democratic Party"
replace partyid = -1 if q328 == "Democrat"
gen educ = .
replace educ = 1 if q6 == "None, or grade 1-8"
replace educ = 1 if q6 == "High school incomplete (grades 9-11)"
replace educ = 2 if q6 == "High school diploma or equivalent, no further schooling"
replace educ = 3 if q6 == "Technical or vocational school after high school"
replace educ = 4 if q6 == "Some college, no degree"
replace educ = 5 if q6 == "Associate's or two-year college degree"
replace educ = 6 if q6 == "Four-year college degree"
replace educ = 7 if q6 == "Graduate or professional school after college, no degree"
replace educ = 8 if q6 == "Graduate or professional degree"
*Trimming
drop if durationinseconds < 60
*Testing for randomization
reg control partyid
reg notag partyid
reg tag partyid
reg super partyid 
reg control educ
reg notag educ
reg tag educ
reg super educ
*Summaries
summ noticed if super == 1
summ noticed if tag == 1
summ noticed if notag ==1 
summ noticed if control == 1
summ govfunded if control == 1
summ govfunded if notag == 1
summ govfunded if tag == 1
summ govfunded if super == 1
summ trustinmainstream if control == 1
summ trustinmainstream if notag == 1
summ trustinmainstream if tag == 1
summ trustinmainstream if super == 1
*Regressions
reg trustinsocialmedia super tag notag educ partyid
reg fakenewsdanger super tag notag educ partyid
reg fakenewsbygov super tag notag educ partyid
reg madeupnewselections super tag notag educ partyid
reg fakenewsdanger super tag notag educ partyid
reg foreigndisinfo super tag notag educ partyid
reg fakenewsbygov super tag notag educ partyid
reg trustinoutlets2 super tag notag educ partyid
reg russiandanger super tag notag educ partyid
reg trustmainoutlets super tag notag educ partyid
reg fakenewsdanger super tag notag educ partyid
reg foreigndisinfo super tag notag educ partyid
reg madeupnewsaverageamericans super tag notag educ partyid
reg madeupnewselections super tag notag educ partyid
reg madeupnews super tag notag educ partyid
reg journalisttrust super tag notag educ partyid
reg trustinoutlets2 super tag notag educ partyid
reg trustinsocialmedia super tag notag educ partyid
reg trustinmainstream super tag notag educ partyid
reg govfunded super tag notag educ partyid
reg govfunded super tag control educ partyid
reg govfunded super notag control educ partyid
